<template>
  <div class="targetList">
    <el-table ref="table" :data="tableData" stripe border tooltip-effect="dark" max-height="400px" style="width: 100%">
      <el-table-column label="序号" width="60" type="index">
      </el-table-column>
      <el-table-column min-width="200" prop="name" label="质控点">
      </el-table-column>
      <el-table-column prop="intension" label="质控点内涵">
      </el-table-column>
      <el-table-column prop="diagnosisStandard" label="诊断标准">
      </el-table-column>
      <!--<el-table-column-->
      <!--prop="name"-->
      <!--label="归属部门">-->
      <!--</el-table-column>-->
      <el-table-column prop="standardValue" label="标准值">
      </el-table-column>
      <el-table-column prop="targetValue" label="目标值">
      </el-table-column>
      <el-table-column v-if="false" prop="currentValue" label="当前值">
        <template slot-scope="scope">
          <span>{{ scope.row.currentValue }}</span>
          <i v-if="scope.row.contrastResult  == 0" class="el-icon-bottom red"></i>
          <i v-if="scope.row.contrastResult  == 1" class="el-icon-minus"></i>
          <i v-if="scope.row.contrastResult  == 2" class="el-icon-top green"></i>
        </template>
      </el-table-column>

      <!-- <el-table-column
                prop="handworkMaintainValue"
                label="手工维护值">
            </el-table-column> -->
      <el-table-column prop="autoUpdateValue" label="业务系统数据">
      </el-table-column>
      <el-table-column prop="personnelTrainingState" label="填报系统数据">
      </el-table-column>
      <el-table-column prop="correctValue" label="校准值">
      </el-table-column>
      <el-table-column v-if="isResult" prop="correctValueContrastValue" label="上一次值">
      </el-table-column>
      <el-table-column v-if="isResult" prop="correctValueContrastResult" label="对比结果">
        <template slot-scope="scope">
          <i v-if="scope.row.correctValueContrastResult == 0" class="el-icon-bottom red stateIcon"></i>
          <i v-else-if="scope.row.correctValueContrastResult == 2" class="el-icon-top stateIcon green"></i>
          <i v-else class="el-icon-minus blue stateIcon"></i>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'targetList',
  props: {
    isResult: {
      type: Boolean,
      default: true
    },
    tableData: {
      type: Array
    }
  }
}
</script>

<style lang="scss" scoped>
.targetList {
  .green {
    color: #73c74a;
  }
  .red {
    color: #ff686e;
  }
  .blue {
    color: #409eff;
  }
  .stateIcon {
    font-size: 20px;
    font-weight: 900;
  }
}
</style>
